import formBuilder from "@/comps/form/formBuilder";
import api from "./api";
/*
fb.addText("name","版本描述",3)
fb.addText("app","APP",3)
fb.addText("dir","上传路径",3)
fb.addText("starter","启动命令",3)
fb.addText("config","配置内容",3)
fb.addText("configFile","配置文件",3)
fb.addText("logs","日志记录",3)
fb.addText("ftpOpen","ftp开关",3)
fb.addText("ftpPort","ftp端口",3)
fb.addText("ftpUser","ftp账号",3)
fb.addText("ftpPass","ftp密码",3)

* */
export default {
    main:function () {
        let fb = formBuilder()
        fb.setLabelWidth(100)

        fb.addText("name").setSpan(3).setLabel("姓名")

        fb.addText("sort").setSpan(3).setLabel("排序").setTypeNumber()

        return fb
    },
    tree:function () {
        let fb = formBuilder()
        fb.setLabelWidth(100)

        fb.addCascade("parentId").setLabel("上级分类").setSpan(3)
            .setApi(api.urlTree)

        fb.addText("name").setSpan(6).setLabel("分类名称")
            .setRules([fb.R.notNull("名称不能为空")])

        fb.addText("sort").setSpan(3).setLabel("排序").setTypeNumber()
        return fb
    },
    other:function () {
        let fb = formBuilder()
        fb.setLabelWidth(100).setLabelPosition("right")

        return fb
    }
}